package com.license.common.util;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * Created with IntelliJ IDEA.
 * User: Ionuc
 * Date: 10/20/12
 * Time: 4:25 PM
 * To change this template use File | Settings | File Templates.
 */
public class DbConnection {

    private static Connection con;
    private static String username = "root";
    private static String password = "pass";
    private static String url="jdbc:mysql://localhost:3306/sr24";
    private static String driver = "com.mysql.jdbc.Driver";

    public static Connection getCon() {
        try{
        Class.forName(driver);
        con = DriverManager.getConnection(url, username, password);
        return  con;
        } catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    public void setCon(Connection con) {
        this.con = con;
    }
}
